/**
 * 车队管理
 * @author xingzb
 * @date 2020-1-7
 */
import request from '@/utils/request'

// 获取 车队列表
export function getDriverTeamList(query) {
  return request({
    url: '/arpa-basic-api/driver',
    method: 'get',
    params: query
  })
}

// 新增 车队
export function addDriverTeam(query) {
  return request({
    url: `/arpa-basic-api/driver/save`,
    method: 'post',
    data: query
  })
}

// 获取 指定车队信息
export function getDriverTeam(code) {
  return request({
    url: `/arpa-basic-api/driver/${code}`,
    method: 'get'
  })
}

// 更新 指定车队
export function updateDriverTeam(query) {
  return request({
    url: `/arpa-basic-api/driver/update`,
    method: 'put',
    data: query
  })
}

// 删除 指定车队/司机
export function delDriverTeam(query) {
  return request({
    url: `/arpa-basic-api/driver/batchDel`,
    method: 'delete',
    params: query
  })
}

// 获取 司机列表
export function getTeamDriverList(query) {
  return request({
    url: '/arpa-basic-api/driver/teamDriverList',
    method: 'get',
    params: query
  })
}

// 获取 指定司机
export function getTeamDriver(code) {
  return request({
    url: `/arpa-basic-api/driver/teamDriverList/${code}`,
    method: 'get'
  })
}

// 冻结 指定司机
export function freezeTeamDriver(query) {
  return request({
    url: `/arpa-basic-api/driver/freeze`,
    method: 'post',
    params: query
  })
}

// 解冻 指定司机
export function unfreezeTeamDriver(query) {
  return request({
    url: `/arpa-basic-api/driver/unfreeze`,
    method: 'post',
    params: query
  })
}

// 获取 指定车队下车辆列表
export function getBindList(query) {
  return request({
    url: `/arpa-basic-api/vehicle/bindList`,
    method: 'get',
    params: query
  })
}

// 绑定 指定车辆
export function bindVehicle(query) {
  return request({
    url: `/arpa-basic-api/driver/bindVehicle`,
    method: 'post',
    params: query
  })
}

// 解绑 指定车辆
export function unbindVehicle(query) {
  return request({
    url: `/arpa-basic-api/driver/unbindVehicle`,
    method: 'post',
    params: query
  })
}

// 新增/更新 车队车辆
export function addOrUpdateVehicle(query) {
  return request({
    url: `/arpa-basic-api/vehicle/addOrUpdate`,
    method: 'post',
    params: query
  })
}

// 获取 车队车辆
export function getVehicle(code) {
  return request({
    url: `/arpa-basic-api/vehicle/${code}`,
    method: 'get'
  })
}

// 删除 车队车辆
export function delVehicle(query) {
  return request({
    url: `/arpa-basic-api/vehicle/`,
    method: 'delete',
    params: query
  })
}

// 冻结 车队车辆
export function freezeVehicle(query) {
  return request({
    url: `/arpa-basic-api/vehicle/freeze`,
    method: 'post',
    params: query
  })
}

// 解冻 车队车辆
export function unfreezeVehicle(query) {
  return request({
    url: `/arpa-basic-api/vehicle/unfreeze`,
    method: 'post',
    params: query
  })
}

// 获取 司机列表
export function getInviteDriverList(query) {
  return request({
    url: '/arpa-basic-api/driver/inviteDriverList',
    method: 'get',
    params: query
  })
}

// 邀请 司机加入
export function inviteDriver(query) {
  return request({
    url: '/arpa-basic-api/inviteApplyRecord/batchInvite',
    method: 'post',
    params: query
  })
}

// 获取 邀请列表
export function getInviteApplyList(query) {
  return request({
    url: '/arpa-basic-api/inviteApplyRecord/inviteApplyList',
    method: 'get',
    params: query
  })
}

// 获取 当前登陆详情
export function getDriverInfo(query) {
  return request({
    url: '/arpa-basic-api/driver/driverInfo',
    method: 'get',
    params: query
  })
}

// 车队管理-删除司机
export function batchDelFromTeam(query) {
  return request({
    url: `/arpa-basic-api/driver/batchDelFromTeam`,
    method: 'delete',
    params: query
  })
}
